<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<form class="form-horizontal" role="form" id="form">

    <div class="form-group">
        <label for="aa" class="col-sm-2 control-label">aa</label>
        <div class="col-sm-10">
            <div id="aa" class="cc-Text" initValue="1"    remark="aa" ></div>
        </div>
    </div>
    <div class="form-group">
        <label for="bb" class="col-sm-2 control-label">bb</label>
        <div class="col-sm-10">
            <div id="bb" class="cc-Text" initValue="2"  onchange="ccHandler"  remark="bb" ></div>
        </div>
    </div>
    <div class="form-group">
        <label for="cc" class="col-sm-2 control-label">cc</label>
        <div class="col-sm-10">
            <div id="cc" class="cc-Text"   remark="cc" ></div>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">

            <input type="button" value="getAddData" onclick="getAddData()">
            <input type="button" value="getEditData" onclick="getEditData()">
        </div>
    </div>
</form>

<script type="text/javascript" src="/lib/jquery/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/lib/layer/layer.js"></script>

<script type="text/javascript" src="/lib/handlebars/handlebars-v4.0.5.js"></script>
<script type="text/javascript" src="/lib/handlebars/handlebars-extend.js"></script>

<link href="/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<script type="text/javascript" src="/lib/bootstrap/js/bootstrap.min.js"></script>

<script type="text/javascript"  src="/lib/common/common.js"></script>

<link type="text/css" href="/lib/component/css/cc.css" rel="stylesheet" />
<script type="text/javascript"  src="/lib/component/js/cc.js"></script>

<script type="text/javascript">
    $(function(){
        _$.parser.parse()
    });
    function getAddData(){

        var form = new _$.Form("#form");
        var values = form.getAddData();
        alert(JSON.stringify(values))
    }
    function getEditData(){

        var form = new _$.Form("#form");
        var values = form.getEditData();
        alert(JSON.stringify(values))
    }


    var ccHandler=function(e){
        var aa = _$.getById("aa");
        var bb = _$.getById("bb");
        var cc = _$.getById("cc");

        var res = parseInt(aa.getValue()) + parseInt(bb.getValue());
        cc.setValue(res);
    }
</script>
</body>
</html>
